//
//  HomeHeadView.swift
//  Order
//
//  Created by Lazyloading on 2020/7/22.
//  Copyright © 2020 lazyloading. All rights reserved.
//

import UIKit


/// 主页头部
class HomeHeadView: UIView {

    var orderSwitchBlock : ((UIButton)->())?
    
    @IBOutlet weak var priceLabel: UILabel!
    @IBOutlet weak var typeLabel: UILabel!
    @IBOutlet weak var orderBtn: UIButton!
    @IBOutlet weak var bottomView: UIView!
    @IBOutlet weak var actionLabel: UILabel!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.backgroundColor = .white;
        self.actionLabel.textColor = ZMColor.Orange.orange1;
        self.typeLabel.textColor = ZMColor.Orange.orange1;
        self.priceLabel.textColor = ZMColor.Orange.orange1;
        
        self.orderBtn.backgroundColor = ZMColor.Orange.orange2;
//        self.bottomView.backgroundColor = ZMColor.Orange.orange1;
        self.orderBtn.setTitle("开始接单", for: .normal);
        self.orderBtn.setTitle("停止接单", for: .selected);
        self.typeLabel.text = "类型";
        self.actionLabel.text = "操作";
     
        
        self.bottomView.layer.cornerRadius = 15.0;
        self.bottomView.layer.masksToBounds = true;
        self.bottomView.layer.borderColor = ZMColor.Orange.orange1.cgColor;
        self.bottomView.layer.borderWidth = 0.8;
        
        self.orderBtn.layer.cornerRadius = 25.0;
        self.orderBtn.layer.masksToBounds = true;
        self.orderBtn.layer.borderColor = UIColor.white.cgColor;
        self.orderBtn.layer.borderWidth = 0.8;
        
    }

    @IBAction func orderBtnAction(_ sender: UIButton) {
        if self.orderSwitchBlock != nil{
            self.orderSwitchBlock!(sender);
        }
    }
    
}
